package cn.yunhe.biz;

import cn.yunhe.bean.User;
import cn.yunhe.dao.UserMapper;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

public class UserService {

    SqlSession session=SqlSessionFactoryUtil.getSqlSession();
    UserMapper usermapper=session.getMapper(UserMapper.class);
    public User userLogin(User user){

        return usermapper.userLogin(user);
    }

    public int userRegister(User user){
        int flag=usermapper.userRegister(user);
        session.commit();
        return flag;
    }

    public User checkName(String username){
        return usermapper.checkName(username);
    }

}
